<template>
  <div id="SamstoFridge">
    <breadcrumb content="样本浏览" />
    <div class="bodyContent">
      <Splitpanes class="area" click>
        <Pane size="16">
          <el-tabs type="border-card">
            <el-tab-pane label="位置选择">
              <SamstoFridgeSelect ref="specboxModelListRef" :currentRow="curSelectRow" @findList="findList" @clickCell="clickCell" @addCell="addMethod" />
            </el-tab-pane>
          </el-tabs>
        </Pane>

        <Pane size="22">
          <div class="bankContent">

            <el-tabs type="border-card" v-model="activeName">
              <el-tab-pane label="仓位选择" name="infoForm">
                <SamstoSpecboxSelect ref="samstoSpecboxSelectRef" :currentRow="curSelectRow" :asknDicts="asknDicts" @findList="findList" />
              </el-tab-pane>
            </el-tabs>
          </div>
        </Pane>

        <Pane size="32">
          <div class="bankContent">
            <!--            v-model="activeName"-->
            <el-tabs type="border-card" v-model="activeLablist">
              <el-tab-pane label="当前在库标本" name="inLablist">
                <StoragedisplayLab ref="storagedisplayLabRef" @clickCell="showLabInfo" @findList="findList" />
              </el-tab-pane>
              <el-tab-pane label="历史存储标本" name="hisLablist">
                <StoragedisplayLab ref="storagedisplayLab1Ref" @clickCell="showLabInfo" @findList="findList" />
              </el-tab-pane>
            </el-tabs>
          </div>
        </Pane>

        <Pane size="20">
          <div class="bankContent">

            <el-tabs type="border-card" v-model="activeName">
              <el-tab-pane label="标本详情" name="infoForm">
                <SamStoLabInfo ref="samStoLabInfoRef" :currentRow="curSelectRow" @findList="findList" />
              </el-tab-pane>
            </el-tabs>
          </div>
        </Pane>
      </Splitpanes>
    </div>
  </div>
</template>

<script lang="ts" setup>
// 引入组件区 ==========
import Breadcrumb from '@/components/Breadcrumb.vue'; //面包屑
import { reactive, ref, getCurrentInstance, onMounted, watch } from 'vue';
import { Splitpanes, Pane } from 'splitpanes';
import { AppStore } from '@/stores/store';
import SamstoSpecboxModelForm from "./form/SamstoSpecboxModelForm.vue";
import SamstoFridgeSelect from "./storagedisplay/SamstoFridgeSelect.vue";
import SamstoSpecboxSelect from "./storagedisplay/SamstoSpecboxSelect.vue";
import StoragedisplayLab from "./storagedisplay/StoragedisplayLab.vue";
import SamStoLabInfo from "./storagedisplay/SamStoLabInfo.vue";
import { IsEmpty } from '@/utils/common';
let store = AppStore();

// 全局变量定义区 ==========
let { proxy }: any = getCurrentInstance();

// 左侧表格:
const curSelectRow = ref({});
const asknDicts = reactive([]);
const isPageDisabled = ref(true);
// 右侧表单:
const samstoFridgeSelectRef = ref<InstanceType<typeof SamstoFridgeSelect>>(); //基本信息表单标记ref
const samstoSpecboxSelectRef = ref<InstanceType<typeof SamstoSpecboxSelect>>(); //基本信息表单标记ref
const storagedisplayLabRef = ref<InstanceType<typeof StoragedisplayLab>>(); //基本信息表单标记ref
const samStoLabInfoRef = ref<InstanceType<typeof SamStoLabInfo>>(); //基本信息表单标记ref
const activeName = ref('infoForm');
const activeLablist = ref('inLablist');

// 方法定义区 =============
onMounted(() => {

});

// 表格选中当前行
function showLabInfo(row: any) {
  curSelectRow.value = row;
  samStoLabInfoRef.value?.loading(row);
}


// 新增
async function addMethod() {
  activeName.value = "infoForm";
}


</script>
<style lang="scss" scoped>
#SamstoFridge {
  width: 100%;
  height: 100%;
  .bodyContent {
    // 面包屑40px  上下间距10px
    height: calc(100% - 60px);
    .area {
      background-color: $base-white;
      // 附加按钮间距
      .button-blue,
      .button-red {
        margin: 5px 0 5px 5px;
      }
      .tableBox {
        height: calc(100% - 40px);
      }
      .el-tabs {
        border: none;
        height: 100%;
        :deep(.el-tabs__content) {
          padding: 0;
          height: calc(100% - 39px);
          .el-tab-pane {
            height: 100%;
          }
          #pane-0 {
            padding: 15px;
            height: calc(100% - 30px);
          }
        }
      }
    }
    .bankItemContent {
      min-height: 600px;
      border-radius: 10px;
    }

    .disabled {
      pointer-events: none;
      opacity: 0.5;
    }
  }
}
</style>

